1 / 5

CS 301 Fall 2001 I/O routines

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.

rkissell
Download Presentation

CS 301 Fall 2001 I/O routines

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. CS 301 Fall 2001I/O routines Slides by Prof. Hartman, following “PC Assembly Language”by Paul Carter

  2. 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

  3. 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

  4. 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.

  5. 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.

More Related