1 / 4

TAL 2

TAL 2. Input/Output in TAL. In TAL, the input and output are responsibilities of the operating system. TAL uses the instruction syscall to request the operating system to perform a specified task.

nona
Download Presentation

TAL 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TAL 2

  2. Input/Output in TAL • In TAL, the input and output are responsibilities of the operating system. TAL uses the instruction syscall to request the operating system to perform a specified task. • The parameters that are needed to execute the system calls are passed via registers. Register $2 contains the function to be performed. • The arguments must in the correct registers when the system calls are executed. • The results of the system calls are placed in the specified registers.

  3. function $2 value arguments results print_int 1 $4=integer print_string 4 $4=string read_int 5 $2=integer read_string 8 $4=buffer, $5=length exit 10 print_char 11 $4=ascii read_char 12 $2=ascii Using syscall $v0 = $2 $a1 = $5 $v1 = $3 $a2 = $6 $a0 = $4 $a3 = $7 Register names and their equivalent register numbers

  4. Syscall examples MAL TAL addi $2,$0,11 add $4,$12,$0 syscall putc $12 done addi $2,$0,10 syscall li $v0,4 lui $a0,highadd ori $a0,lowadd syscall puts msg0 la $a0,msg0 These address are determined by the assembler

More Related