Presentation is loading. Please wait.

Presentation is loading. Please wait.

Program Structure Example for Data Segment CRLF EQU 0DH, 0AH PROMPT DB 'Enter a digit between 0 and 9', 0 VAR1 DB ? ARRAY DW 1234h, 23h, 0FF54h.

Similar presentations


Presentation on theme: "Program Structure Example for Data Segment CRLF EQU 0DH, 0AH PROMPT DB 'Enter a digit between 0 and 9', 0 VAR1 DB ? ARRAY DW 1234h, 23h, 0FF54h."— Presentation transcript:

1 Program Structure Example for Data Segment CRLF EQU 0DH, 0AH PROMPT DB 'Enter a digit between 0 and 9', 0 VAR1 DB ? ARRAY DW 1234h, 23h, 0FF54h

2 Program Structure Code Segment The code segment contains all the source code for the program. Use procedures to organize the program code (example below) Assembly Language Syntax General form of assembly language statements: [name] [operation code] [operand(s)] [;comment] 2 Types of Assembly Language Statements: Instructions - part of the machine language instruction set. Instructions will be converted into machine code by the assembler translator. Directives/Pseudo-Operations - directives are NOT part of the machine language instruction set and will be processed by the assembler translator at assembly time.

3 Input and Output Instructions Some basic INT 21H Input/Output Functions: Functio n DescriptionRegister Setup Result 1 Input one character from keyboard with echo to screen AH = 1 AL = ASCII code of the character, if char key pressed, or AL = 0, if non-char key pressed eg:the up arrow 2 Output one character to screen AH = 2 DL = ASCII code or control character code Contents of DL are written on screen Examples shown above: Read a character from the keyboard Display a character on the monitor

4 Displaying a String Function:Description:Input: 9 Display a string AH = 9 DX = offset address of string. String must end with '$'


Download ppt "Program Structure Example for Data Segment CRLF EQU 0DH, 0AH PROMPT DB 'Enter a digit between 0 and 9', 0 VAR1 DB ? ARRAY DW 1234h, 23h, 0FF54h."

Similar presentations


Ads by Google