Computers and Technology

Write a assembly program(mips) that implements a link list to store input lines of text. the program will then print the list constructed.
all nodes and string are to be allocated on the heap. node structure:
address data
address next
nodes are to be added to the head of the list
int strlen(cstring soure) : returns the length of a source (‘\0’ not counted)
cstring strdup(cstring source) : returns a duplicate of source allocated on the heap (sbrk syscall)
address addnode(address data, address next) : returns an address to a new node initialized with data and next traverse(address list, address proc) : traverses the list and calls proc passing the data of the node visit. the last node is to be traversed first.
main:
prompts the user for lines of text (up to 30 characters per line)
creates a link list of these lines head, the lines are to be created using strdup outputs the call traverse(head, print)
print(cstring source) : output source to the terminal
required i/o:
enter text? line 1
enter text? line 2
enter text? enter
line 1
line 2

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, Lacey9319
The editing of digital photos us about the same level of difficulty as editing an analog photo
Answers: 2
image
Computers and Technology, 22.06.2019 11:10, lberman2005p77lfi
The total cost of textbooks for the term was collected from 36 students. create a histogram for this data. $140 $160 $160 $165 $180 $220 $235 $240 $250 $260 $280 $285 $285 $285 $290 $300 $300 $305 $310 $310 $315 $315 $320 $320 $330 $340 $345 $350 $355 $360 $360 $380 $395 $420 $460 $460
Answers: 2
image
Computers and Technology, 22.06.2019 17:20, Korkot7633
[a] create a class called “cycle” which has two instance integer variables as properties, “numberofwheels” and “weight.” create a constructor with two parameters, using the same variable names in the parameter list. assign each variable to numberofwheels” and “weight” respectively. write a separate application to test the class and display its properties. note: do not change the names of the instance variables or the variables listed in the constructor’s parameter list. [b] edit your class cycle by adding a default constructor which will assign the default values of 100 to represent the numberofwheels, and 1000 to represent the weight, by invoking a call to the other constructor. modify your application created in [a] to test the class.
Answers: 3
image
Computers and Technology, 22.06.2019 19:30, ibrahimuskalel
Avariable definition defines the name of a variable that will be used in a program, as well as
Answers: 3
Do you know the correct answer?
Write a assembly program(mips) that implements a link list to store input lines of text. the program...

Questions in other subjects: