在组装工作中,回答这个有趣的问题. [英] in assembly work, answer this interesting question.

查看:101
本文介绍了在组装工作中,回答这个有趣的问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们,我需要知道如何在每次操作后每次按ENTER键时,按字符控制台显示文件字符的内容,以及每次按D时从左上角逐字符删除控制台字符的内容.钥匙 .当没有字符完成时,程序必须
(请帮助我,我将永远感激不已.)

这是程序的一个例子

Guys I need to know how to display the contents of a file character by character console every time you press the ENTER key after this operation and erase the contents of console character by character from the top left corner every time you press the D key . When there is no character is complete the program must
(please help me,I will be eternally grateful.)

this is a example of the program

%define __NR_write 4

%define __NR_open 5

%define __NR_read 3

%define __NR_close 6

%define __NR_exit 1

%define O_RDWR 00002h

%define O_RDONLY 00000h

global main

section .data



%macro INT80 4

  mov eax, %1

  mov ebx, %2

  mov ecx, %3

  mov edx, %4

 int 80h

%endmacro



%macro EscribeConsola 2

 INT80 __NR_write, 1, %1, %2

%endmacro



%macro AbreArchivo 2

 INT80 __NR_open, %1, %2, 0

%endmacro



%macro LeeConsola 2

INT80 __NR_read, 0, %1, %2

%endmacro



%macro LeeArchivo 3

 INT80 __NR_read, %1, %2, %3

%endmacro



%macro EscribeArchivo 3

 INT80 __NR_write, %1, %2, %3

%endmacro



%macro CierraArchivo 1

 INT80 __NR_close, %1, 0, 0

%endmacro



NombreArchivo db ''Pantalla.dat'',0

NombrePantalla db ''/dev/vcsa'',0

MsgError db ''Se produjo un error'',0



section .bss

fdPantalla resd 1

fdEntrada resd 1

Bytes resd 1

Contenido resd 16384

caracter resb 1



section .text

main:

AbreArchivo NombrePantalla,O_RDWR

or eax,eax

js Error

mov [fdPantalla],eax

AbreArchivo NombreArchivo,O_RDONLY

or eax,eax

js Error

mov [fdEntrada],eax

LeeArchivo [fdEntrada],Bytes,4

LeeArchivo [fdPantalla],Contenido,4

LeeArchivo [fdEntrada].Contenido,[Bytes

EscribeArchivo [fdPantalla],Contenido,[Bytes]

CierraArchivo [fdPantalla]

CierraArchivo [fdEntrada]

jump Salir

Error:

     EscribeConsola MsgError,20

Salir:

     Int80 __NR_exit,0,0,0




[edit]删除了垃圾字符[/edit]




[edit]removed garbage characters[/edit]

推荐答案

对您来说也许很有趣,但对我而言却不是.对我来说,它闻起来像硬件.到目前为止你做了什么.向我们显示一些努力,我们将很高兴为您提供帮助.
Well it may be interesting to you, but not me. It smells like HW to me. What have you done so far. Show us some effort and we will be glad to give you a hand.


这篇关于在组装工作中,回答这个有趣的问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆