NOGDUS $1670.00 has been donated to NOGDUS!
July 20, 2017, 11:32:23 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: ECPU BIOS Routines  (Read 2096 times)
0 Members and 1 Guest are viewing this topic.
Richard Marks
Administrator
Offline Offline

Respect: 3425
« on: October 05, 2009, 10:16:12 AM »

BIOS Routines for ECPU Virtual Microcomputer Emulation Device v0.0.6

BIOS Routine Table
Code:
SYS CALL# | ROUTINE NAME
|
0 | get_char
|
1 | get_string
|
2 | get_integer
|
3 | file_open
|
4 | file_read
|
5 | file_read_line
|
6 | file_write
|
7 | file_write_line
|
8 | file_close
|
9 | fill_memory
|

BIOS Routine Details



   get_char addr

   gets a single character from stdin and stores in vram at addr



   get_string addr

   gets a string from stdin and stores in vram starting at addr
   side-effect: data pointer is moved to the end of the stored string



   get_integer addr

   gets an integer from stdin and stores in vram at addr



   file_open addr1 addr1

   reads the filename to be opened from vram starting at addr1
   the filename is assumed to be stored as a null-terminated string.
   reads the mode to open the file in from vram starting at addr2
   the mode is assumed to be stored as a null-terminated string.
   opens the file named {filename} in the specified {mode}.

   valid modes are
      "w" for writing text
      "r" for reading text
      "wb" for writing binary
      "rb" for reading binary
      "a" for appending text

   side-effect: vram at data pointer location gets set to the file handle



   file_read addr count

   reads the file handle from vram at memory location addr
   reads count number of bytes from the file and stores the data in vram
   starting at the data pointer memory location.
   side-effect: data pointer is moved to the end of the data stream



   file_read_line addr

   reads the file handle from vram at memory location addr
   reads up to 80 characters or until the first \n character, whichever
   comes first, from the file and stores the data in vram starting at the
   data pointer memory location.
   side-effect: data pointer is moved to the end of the data stream



   file_write addr1 addr2 count

   reads the file handle from vram at memory location addr1
   writes the data in vram starting at addr2 for count locations to an
   open file



   file_write_line addr1 addr2

   reads the file handle from vram at memory location addr1
   writes the string assumed to be stored in vram at location addr2
   to the open file. the string is assumed to be a null-terminated string.

   
   file_close addr

   reads the file handle from vram at memory location addr
   closes the file if it is open



   fill_memory addr count value

   files vram with value from addr to addr + count


Logged

Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
.: Theme by Richard Marks :.
Valid XHTML 1.0! Valid CSS!