50 likes | 73 Views
Learn how to use I/O routines from Paul Carter's asm_io package to perform printing, input, and debugging operations in PC assembly language.
E N D
CS 301 Fall 2001I/O routines Slides by Prof. Hartman, following “PC Assembly Language”by Paul Carter
To use I/O routines from Carter’s asm_io package • Put the line %include “asm_io.inc” at the beginning of your .asm file. • Put the file asm_io.obj in your project
Printing Routines • print_int – Prints the integer in eax to the screen. • print_char – Prints the ASCII character in al to the screen • print_string – Prints the string stored at the address in eax to the screen • print_nl – Prints a new line character to the screen
Input Routines • read_int – Reads an integer from the keyboard and stores it in eax. • read_char – Reads a character from the keyboard and stores it’s ASCII value in al.
Debug routines • dump_regs – Takes one integer argument. Prints the argument and all registers. • dump_mem – Takes three arguments. First a label (as dump_regs), then a memory location, then a number of paragraphs to print. • dump_stack – Takes three arguments. First a label, then the number of dwords to display below EBP, then the number of dwords to display above EBP. • dump_math – Takes one argument, a label. Displays the math coprocessor registers.