小编Jua*_*blo的帖子

将C函数的值返回给ASM

我正试图从ASM中调用一个函数.我知道如何调用它,但我很难找到如何获得此函数的返回值.一个例子如下:

C代码:

int dummy() {  
    return 5;  
}  
Run Code Online (Sandbox Code Playgroud)

(N)ASM代码:

dummyFunction:
    call dummy
    ;grab return into eax
    inc eax ; eax should be 6 now
    ret  
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

c assembly nasm osdev

11
推荐指数
2
解决办法
2万
查看次数

Bitbucket Pipeline 失败,表示该步骤为空、为空或丢失

我正在尝试配置一个 Bitbucket 管道来执行 SonarQube 管道,但 Bitbucket 抱怨管道步骤为空、为空或丢失。

我已将 SONAR_TOKEN 定义为具有正确令牌的项目变量。

这是我当前的 bitbucket-pipeline.yml 文件:

image: atlassian/default-image:2

clone:
  depth: full

definitions:
  caches:
    sonar: ~/.sonar/cache
  steps:
    - step: &sonarcloud
      name: Analyze on SonarCloud
      caches:
        - sonar
      script:
        - pipe: sonarsource/sonarcloud-scan:0.1.5
          variables:
            SONAR_TOKEN: ${SONAR_TOKEN}

pipelines:
  branches:
    '*':
      - step: *sonarcloud
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

bitbucket bitbucket-pipelines

8
推荐指数
1
解决办法
2623
查看次数

具有静态属性的模板继承(服务定位器模式)

我一直在尝试使用模板化基类实现Service Locator模式并从中继承:

    // Header File
    namespace one {
    template <class I, class N>
    class Locator {
    public:
        static void initialize() {
            service = &nullService;
        }
        static void provide(I* newService) {
            if (newService == 0) {
                initialize();
            } else {
                service = newService;

        }
        static I& get() { return *service; }
        virtual ~Locator() {
            if (service != &nullService) {
                delete service;
            }
    private:
        Locator();
        static I* service;
        static N nullService;
    };
    }

    // Source File
    #include "Locator.hpp"

    namespace one {
    template<class …
Run Code Online (Sandbox Code Playgroud)

c++ inheritance static templates properties

3
推荐指数
1
解决办法
530
查看次数