Presentation is loading. Please wait.

Presentation is loading. Please wait.

ARMSim# and SWIInstructions Plug-in

Similar presentations


Presentation on theme: "ARMSim# and SWIInstructions Plug-in"— Presentation transcript:

1 ARMSim# and SWIInstructions Plug-in
Group 11: Brian Knight Benjamin Moore Alex Williams

2 Outline Overview of SWIInstructions Plug-in for ArmSim#
Basic SWI Operations for I/O Stdin/Stdout/Stderr View ArmSim# I/O Examples with SWI Printing Characters Printing Strings Determining Primes, Reading from Files and Printing to Files

3 SWIInstructions Plug-in Overview
Implements Software Interrupt Codes to allow for common I/O operations Included in ARMSim# 1.91 Download Enabled/Disabled via File->Preferences- >Plugins->SWIInstructions Enabled by Default

4 Types of I/O Operations
Open/close files Write characters and strings to Stdout or file Reading from files and Stdin (Keyboard) Allocate/deallocate memory on Heap Interact with other Plug-ins (ex. Embest Board)

5 SWI Codes

6 SWI Codes SWIcodes from 0 to 255 are forArmSim# I/O, codes above 255 are used for interaction with other ArmSim# plugin modules

7 How SWI Works Not really an exception or a proper interrupt
Enables the user to call routines in supervisor mode Most ARM systems have a well-defined set of operations accessible through SWI

8 Outline Overview of SWIInstructions Plug-in for ArmSim#
Basic SWI Operations for I/O Stdin/Stdout/Stderr View ArmSim# I/O Examples with SWI Printing Characters Printing Strings Determining Primes, Reading from Files and Printing to Files

9 Stdin/Stdout/Stderr View
Where output from user programs is displayed Stdout: Output to file, pipe, or console Stderr: Output stream for errors Requests from Stdin freeze ARMSim# until input is received Input is echoed in Stdin/Stdout/Stderr View

10 Stdin/Stdout/Stderr View

11 Example 1 – Printing Characters
.equ [symbol], [swi code] makes code more readable swi 0x00: Display character stored in R0 to Stdout swi 0x11: Halt execution #’[char] uses ASCII value for character like an immediate value

12 Example 2 – Printing Strings
swi 0x02: Displays an ASCII string to Stdout (Address in R0) String must be null-terminated (.asciz) ASCII for “Hello World!\n” = 48,65,6C,6C,6F,20,57,6F,72,6C, 64,21,0A,00 Little-endian byte address assignment

13 Outline Overview of SWIInstructions Plug-in for ArmSim#
Basic SWI Operations for I/O Stdin/Stdout/Stderr View ArmSim# I/O Examples with SWI Printing Characters Printing Strings Determining Primes, Reading from Files and Printing to Files

14 Example 3 – Is Prime

15 Questions?

16 References http://armsim.cs.uvic.ca/index.html
ARMSim_UserGuide4Plus.pdf ARM system-on-chip architecture, second edition, Steve Furber, Addison Wesley, 2000      

17 Back-Up Slides

18 SWI Instructions step by step
SVC mode is entered R15 is saved to R14_SVC The IRQ disable bit is set The PC is set to address & , this address has the instruction which jumps to the real SWI handler


Download ppt "ARMSim# and SWIInstructions Plug-in"

Similar presentations


Ads by Google