|
|
@@ -1,10 +1,25 @@
|
|
|
+section .bss
|
|
|
+ num resb 5 ;"variable" for numbers
|
|
|
+
|
|
|
section .text
|
|
|
global _start
|
|
|
|
|
|
_start:
|
|
|
- mov edx,1 ;expect message 1 byte
|
|
|
- mov ecx,ecx ;set register?
|
|
|
- mov ebx,1 ;std in?
|
|
|
+ ;Read input 5 byte numeric
|
|
|
+ mov edx,5 ;expect message 1 byte
|
|
|
+ mov ecx,num ;set register?
|
|
|
+ mov ebx,2 ;std in?
|
|
|
mov eax,3 ;set call sys_read
|
|
|
int 0x80 ;kernel exec
|
|
|
|
|
|
+ ;Write input back to console
|
|
|
+ mov edx,5 ;expect message 1 byte
|
|
|
+ mov ecx,num ;set register?
|
|
|
+ mov ebx,1 ;std in?
|
|
|
+ mov eax,4 ;set call sys_read
|
|
|
+ int 0x80 ;kernel exec
|
|
|
+
|
|
|
+ ;exit programm
|
|
|
+ mov eax,1
|
|
|
+ mov ebx,0
|
|
|
+ int 0x80
|