0 Replies - 522 Views - Last Post: 10 December 2018 - 04:42 AM Rate Topic: -----

#1 Kingston111   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-December 18

I am in a trouble with VDU and Virtual Peripheral exercise

Posted 10 December 2018 - 04:42 AM

I am doing a self educating work with Assembler exercises, i am learning step by step and i found an exercise that i want to try understand but here comes the trouble. I need to store all the text that i type in RAM and when i press enter, display will show stored text on the VDU display but instead of using a keyboard i have to use virtual keyboard from Assembler app. I have searched for it in internet and tried to do myself, i managed to create a code that let's me type words with keyboard and after pressing enter VDU screen opens up to show my typed word one by one, now i need to combine virtual keyboard to insert words from there.
Can anyone solve this for me? I am using this program: http://www.softwaref...32v50/index.php
This is a code for VDU:
; --------------------------------------------------------------
; Input key presses from the keyboard until Enter is pressed.
; --------------------------------------------------------------
CLO ; Close unwanted windows.
MOV BL, A0 ; Move value to top left
Rep:

IN 00 ; Wait for key press - Store in AL.
MOV [BL], AL ; Move value held in BL memory location into display
INC BL ; Increment BL
CMP AL, 0D ; Compare -- was it the Enter key? (ASCII 0D)
JNZ Rep ; No - Jump back. Yes - end.
MOV CL, C0 ; start of VDU
MOV AL, A0 ; stored character pointer to AL

Rep01: MOV DL, [AL] ; get stored character
MOV [CL], DL ; put on VDU
INC CL ; next char. on VDU
INC AL ; next stored character
CMP CL, 00 ; end of VDU memory?
JNZ Rep01 ; no, loop
END

; --------------------------------------------------------------

And this is a code for virtual keyboard:
jmp start
db 10 ; Hardware Timer Interrupt Vector
db 20 ; Keyboard Interrupt Vector

; ===== Hardware Timer =======
org 10
nop ; Do something useful here
nop
nop
nop
nop
iret
; ============================

; ===== Keyboard Handler =====
org 20
CLI ; Prevent re-entrant use
push al
pushf

in 07
nop ; Process the key press here
nop
nop
nop
nop

popf
pop al
STI
iret
; ============================

; ===== Idle Loop ============
start:
STI ; Set (I) flag
out 07 ; Make keyboard visible
idle:
nop ; Do something useful here
nop
nop
nop
nop
jmp idle
; ============================
end
; ============================
I need to combine Virtual keyboard code with VDU code to get the following:
Store all the text you type with virtual keyboard in RAM when you type it in. When you press Enter, display the stored text on the VDU display.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1