Assembly Pretest

 avatar
user_3924995
plain_text
5 months ago
5.6 kB
5
Indexable
;2021.11.22
;==========================================================================
;Name:
;Neptun code:
;Date: 19.12.2016
;
;==========================================================================
Code Segment
	            assume CS:Code, DS:Data, SS:Stack

	Start:      

	            mov    ax, Code
	            mov    DS, AX

	            mov    ax, 03h
	            int    10h

	            mov    ah,9
	            mov    dx, offset task1
	            int    21h
	
	            mov    dh, 2
	            mov    dl, 5
	            xor    bx, bx
	            mov    ah, 02
	            int    10h
	
	            xor    ax, ax
	            xor    bx, bx
	            xor    cx, cx
	            xor    dx, dx
	            xor    di, di
	            xor    si, si
	
	;Task_1:
	;==========================================================================
	;1. Task:
	; Fill the "name" string (you can be found it at strings) with your own name, with lowercase letters
	; using only english letters (eg "joe black"), and then display it in the next form:
	; BLACK, Joe
	; That is : SURENAME, Firstname
	;==========================================================================
	
	;**************************************************************************
	;Write here the appropriate program part, using the code found here!
	



	
	

	;so far
	;**************************************************************************
	            xor    ax, ax
	            int    16h

	;==========================================================================
	;2. task:
	; VGA (320x200px, 8bit)
	; Draw a square standing on his vertex.
	; length of side: 80 pixels,
	; coordinates of the upper vertex is in CX register!
	;
	;**************************************************************************
	;VGA mode
	            mov    ax, 13h
	            int    10h
	            mov    ax, 0a000h
	            mov    es, ax
	
	            xor    ax, ax
	            xor    bx, bx
	            xor    dx, dx
	            xor    di, di
	            xor    si, si
	
	;start coordinates
	            mov    cl,100                     	;row
	            mov    ch,150                     	;column

	;**************************************************************************
	;Write here the appropriate program part!






	;so far
	;==========================================================================
	Var:        
	            xor    ax,ax
	            int    16h
	
	Task_3:     
	;===========================================================================
	; 3. task:
	;
	; Perform the operation founded in 'operation' string!
	; The two number (0..9, single digits!), and the operation(+,-,*,/) can be any,
	; the string content has to process!
	;
	; There is enough to display only one character as a result! The div enough to display the result,
	; the residue should not!
	;
	; Display the operation, and the result (single digits)!
	; eg: 3+2=5
	; 3-2=1
	; 3*2=6
	; 3/2=1
	;===========================================================================
	            mov    ax, 03h
	            int    10h

	            mov    ah,9
	            mov    dx, offset task3
	            int    21h

	            mov    dh, 2
	            mov    dl, 5
	            xor    bx, bx
	            mov    ah, 02
	            int    10h
	
	            mov    ah,9
	            mov    dx, offset operation
	            int    21h

	
	            xor    ax, ax
	            xor    bx, bx
	            xor    cx, cx
	            xor    dx, dx
	            xor    di, di
	            xor    si, si
	

	; --------------------------------------------------------------------------
	;Write here the appropriate program part!






	; so far
	; --------------------------------------------------------------------------
	; Waiting for a keystroke
	            xor    ax, ax
	            int    16h
	

	Task_4:     
	;------------------------------------------------------------------------
	; 4. task:
	;
	; Display the sentence4 string at the 10th row!
	; The string shall move from left side to right side on tbe screen,
	; and back, twice.
	;
	;===========================================================================
	            mov    ax, 03h
	            int    10h
	
	            mov    ah,9
	            mov    dx, offset task4
	            int    21h

	            xor    ax, ax
	            xor    bx, bx
	            xor    cx, cx
	            xor    dx, dx
	            xor    di, di
	            xor    si, si
	

	;-------------------------------------------------------------------------
	;Write here the appropriate program part!












	; so far
	; ------------------------------------------------------------------------
	; Waiting for a keystroke
	            xor    ax, ax
	            int    16h
	;===========================================================================

	End_Program:
	            mov    ax, 3
	            int    10h
	
	            pop    ax
	            mov    ax, 4c00h
	            int    21h

	;strings:
	task1       db     "1. task, Name: $"
	nev         db     "studentname lowercase$"

	task3       db     "3. task: Operation: $"
	muvelet     db     "3+2=$"


	task4       db     "4. task: Moving string: $"
	sentence4   db     "Wow moves!"






Code Ends

Data Segment

Data Ends

Stack Segment

Stack Ends
	End	Start

Editor is loading...
Leave a Comment