如何在宏观asm中声明局部变量,就像在宏观asm中使用%local在macrom的asm中或在masm的宏asm中本地声明一样?

时间:2016-01-12 17:04:30

标签: assembly nasm masm gas att

在nasm的宏asm中声明局部变量的方法就像:%local old_ax:word,以及在masm的宏asm中声明局部变量的方式就像:local old_ax:WORD,那么是什么' s如何在宏观的天然气中声明局部变量?

1 个答案:

答案 0 :(得分:0)

MacBook-Pro:spec sab$ protractor protractor.conf.js -gulpe2e:local Using the selenium server at http://127.0.0.1:4444/wd/hub [launcher] Running 1 instances of WebDriver /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:174 callback(new Error(message)); ^ Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444 at ClientRequest.<anonymous> (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:174:16) at emitOne (events.js:77:13) at ClientRequest.emit (events.js:169:7) at Socket.socketErrorListener (_http_client.js:265:9) at emitOne (events.js:77:13) at Socket.emit (events.js:169:7) at emitErrorNT (net.js:1256:8) at nextTickCallbackWith2Args (node.js:455:9) at process._tickCallback (node.js:369:17) From: Task: WebDriver.createSession() at Function.webdriver.WebDriver.acquireSession_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22) at Function.webdriver.WebDriver.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30) at [object Object].Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:445:22) at [object Object].DriverProvider.getNewDriver (/usr/local/lib/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7) at [object Object].Runner.createBrowser (/usr/local/lib/node_modules/protractor/lib/runner.js:186:37) at /usr/local/lib/node_modules/protractor/lib/runner.js:276:21 at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:797:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:826:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:759:13) at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:525:49 [launcher] Process exited with error code 1 主要用作编译器后端,不适合人类使用。因此,它缺乏一些功能,其中包括这一功能。当然,您可以尝试制作宏来执行此操作,具体如下:

gas

但一般来说,你可以直接使用equates for stack offsets,例如:

.intel_syntax noprefix
.globl main

.macro local head, tail:vararg
# assume dwords for simplicity
.set localsize, localsize + 4
.set \head, -localsize
.ifnb \tail
local \tail
.endif
.endm

main:
    .set localsize, 0
    local old_ax, old_dx
    enter localsize, 0
    mov [ebp+old_ax], ax
    mov [ebp+old_dx], dx
    leave
    ret