Ej N.

asked • 11/17/22

How do you count characters in a string in assembly language

I am currently working on a lab for my cs class. Part of the lab is asking for us to make a function that counts the length of a file. The file has a long string inside of it and we need to count the characters in that file. Here is more info on the function


"length_of_file:

#function to find length of data read from file

#arguments: a1=bufferAdress holding file data

#return file length in a0"


" This. asm file contains a function that you will write to find the total amount of data bytes in the csv file. "


"This function is to be written in length_of_file.asm. It accepts as argument in a1 register the buffer address holding file data and returns in a0 the length of the file data in bytes.

From our example involving data.csv, length_of_file(0xffff0000)=119"



1 Expert Answer

By:

Tej S. answered • 11/17/22

Tutor
5 (3)

Experienced tutor in a wide variety of fields; Brown University

Ej N.

thank you! I will work on this and if I have any more questions or concerns!
Report

11/17/22

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.