叫我小袁就行 2015-05-02 10:09 采纳率: 100%
浏览 3116
已采纳

如何在汇编中call scanf_s 输入一个字符 求求求!

这是在汇编中call scanf_s 输入Integer 的部分代码

    char format[]="%d"; //format string for the scanf function 
    int first;
    _asm{ 

          lea eax,first
          push eax 
          lea eax,format; 读取第一个number 
          push eax 
          call scanf_s
          add esp,8

            mov eax,dword ptr [first]
            push eax
            lea eax,format
            push eax
            call printf
            add esp,8

    }
  • 写回答

2条回答 默认 最新

  • zzkjliu 2015-05-02 13:02
    关注

    _asm{

        lea eax,input;
        push eax;
        lea eax,formats;
        push eax;
        call dword ptr[scanf];
        add esp,8;
    
        lea eax, input;
        push eax
        lea eax,formats;
        push eax;
        call dword ptr[printf];
        add esp,8;
    
    
            你的代码在有些VC版本是可以的。
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。