Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Using MON12 Utility Functions for I/O in EECS 388: Computer Systems and Assembly Language, Lab Reports of Electrical and Electronics Engineering

Information about mon12 utility functions used for input and output operations in the eecs 388: computer systems and assembly language course. The functions include upcase, outa, out1byt, outcrlf, outstrg, and inchar. The document also includes examples of how to use these functions in assembly language code. Students can use this document as study notes, lecture notes, summaries, or cheat sheets to understand the mon12 utility functions and their usage.

Typology: Lab Reports

Pre 2010

Uploaded on 09/17/2009

koofers-user-qrx
koofers-user-qrx 🇺🇸

5

(1)

10 documents

1 / 5

Toggle sidebar

Related documents


Partial preview of the text

Download Using MON12 Utility Functions for I/O in EECS 388: Computer Systems and Assembly Language and more Lab Reports Electrical and Electronics Engineering in PDF only on Docsity! 1 EECS 388: Computer Systems and Assembly Language Lab 7: Using MON12 Utility Subroutines for I/O MON12 Utility Functions Below are the descriptions of some of the utility functions, taken from the MON12 manual included with the Axiom CD (Documents/Mon12man.pdf). UPCASE If character in accumulator A is lower case alpha, convert to upper case. OUTA Output accumulator A ASCII character. OUTlBYT Convert binary byte at address in index register X to two ASCII characters and output. Returns address in index register X pointing to next byte. OUTCRLF Output ASCII carriage return followed by a line feed. OUTSTRG Output string of ASCII bytes pointed to by address in index register X until character is an end of transmission ($04). OUTSTRGO Same as OUTSTRG except leading carriage return and line feed is skipped. INCHAR Input ASCII character to accumulator A and echo back. This routine loops until character is actually received. MON12 Service Routine Jump Table Below is a table of the MON12 utility functions and their addresses, taken from the CMLS12DP256 manual (Documents\manuals\CMLS12DP256man.pdf on the Axiom CD). It’s also available in the “references” section of the class website. ADDRESS ff10 MAIN ; warm start ff13 BPCLR ; clear breakpoint table ff16 RPRINT ; display user registers ff19 HEXBIN ; convert ascii hex char to binary ff1c BUFFARG ; build hex argument from buffer ff1f TERMARG ; read hex argument from terminal ff22 CHGBYT ; modify memory byte at address in x ff25 JMP CHGWORD ; modify memory word at address in x ff28 READBUFF ; read character from buffer ff2b INCBUFF ; increment buffer pointer ff2e DECBUFF ; decrement buffer pointer ff31 WSKIP ; find non-whitespace char in buffer ff34 CHKABRT ; check for abort from terminal ff37 JMP UPCASE ; convert to upper case ff3a WCHEK ; check for white space ff3d DCHEK ; check for delimeter ff40 ONSCI0 ; initialize i/o device ff43 INPUT ; low level input routine ff46 OUTPUT ; low level output routine ff49 OUTLHLF ; display top 4 bits as hex digit ff4c OUTRHLF ; display bottom 4 bits as hex digit 2 ff4f OUTA ; output ascii character in A ff52 OUT1BYT ; display the hex value of byte at X ff55 OUT1BSP ; out1byt followed by space ff58 OUT2BSP ; display 2 hex bytes (word) at x and a space ff5b OUTCRLF ; carriage return, line feed to terminal ff5e OUTSTRG ; display string at X (term with $04) ff61 OUTSTRG0 ; outstrg with no initial carr ret ff64 INCHAR ; wait for and input a char from term ff67 VECINIT ; initialize RAM vector table Examples: To use a utility function, simply do a JSR to the memory address. For example, to output an ASCII character that’s in accumulator A, you can use the following code. It’s considered good form to label your functions, rather than just jumping to the memory locations. OUTA equ $FF4F ldaa #$67 ;Load A with a lowercase “g.” jsr OUTA ;Print “g” to the monitor. Ex1. Prompting the user: Define your message text using FCC, and call the OUTSTRG function. OUTSTRG equ $FF5E EOT equ $04 ldx #FIRST org $4000 jsr OUTSTRG ;Print the string until EOT. swi org $6000 FIRST fcc 'Enter first number:' fcb #EOT Ex2. Reading a character from the keyboard: Define INCHAR with the correct address, similarly to the previous example. This function waits for the user to enter a character, and then stores it in accumulator A. jsr INCHAR ;Take in a character Accumulator A now has the ASCII value of the character.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved