Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;==========================================================================
- ;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 sides: 64pixel
- ; 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,100 ;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:
- ;
- ; Hexadecimal->Decimal conversion
- ; Display in decimal format the number founded in "number" string. (max. value: 0FFh)!
- ;-------------------------------------------------------------------------
- mov ax, 03h
- int 10h
- mov dx, offset task4
- mov ah, 09h
- int 21h
- mov dh, 2
- mov dl, 5
- xor bx, bx
- mov ah, 02
- int 10h
- mov dx, offset number
- mov ah, 09h
- int 21h
- ;-------------------------------------------------------------------------
- ;Write here the appropriate program part!
- ; so far
- ; ------------------------------------------------------------------------
- ; Waiting for a keystroke
- xor ax, ax
- int 16h
- ;===========================================================================
- ; 5. task:
- ;
- ; Display the sentence5 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 task5
- 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
- ;===========================================================================
- ; 6. task:
- ;
- ; Automatic exit
- ; Use the exit6 string! Fill it with '*' character per second,
- ; and when it reaches the end of the string, exits!
- ; 1 second = 18 tick!
- ; With the length of the string can be change the exit time!
- ; Sample:
- ; "| |$"
- ; "|* |$"
- ; "|** |$"
- ; "|*** |$"
- ; "|**** |$"
- ; "|***** |$"
- ; "|****** |$"
- ; "|*******|$" -> JMP End_Program
- ;
- ;===========================================================================
- mov ax, 03h
- int 10h
- mov dx, offset task6
- mov ah,9
- int 21h
- mov dh, 2
- mov dl, 5
- xor bx, bx
- mov ah, 02
- int 10h
- mov dx, offset exit6
- mov ah,9
- 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: Hexadecimal -> Decimal$"
- szam db "0A1h=$"
- task5 db "5. task: Moving string: $"
- sentence5 db "Wow moves!"
- task6 db "6. task: automatic exit: $"
- exit6 db "| |$"
- Code Ends
- Data Segment
- Data Ends
- Stack Segment
- Stack Ends
- End Start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement