小编Mic*_*tch的帖子

sin(x)的汇编代码

我想sin(x)在Linux中使用汇编代码进行计算(使用"Taylor Expansion").

x86 assembly trigonometry

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

"非法指令:4"出现在OS X Lion中

一些C++应用程序编译和OS X Snow Leopard中无缝运行,但我最近改为OS X Lion中,在这里,虽然没有编译错误,当我尝试运行它,我得到的错误"非法指令:4",我不知道,可能是什么原因?

PS:

这些是我使用的链接标志

-Wl,-stack_size,0x10000000,-stack_addr,0xc0000000 
Run Code Online (Sandbox Code Playgroud)

这是我得到的输出 sudo truss executable

setrlimit returned result = -1
    SYSCALL(args)        = return
getpid(0x0, 0x0, 0x0)        = 32993 0
__sysctl(0xBFFFF5EC, 0x3, 0xBFFFF5E8)        = 0 0
issetugid(0xBFFFF5EC, 0x3, 0xBFFFF5E8)       = 0 0
csops(0x0, 0x0, 0xBFFFF65C)      = 0 0
shared_region_check_np(0xBFFFD5E0, 0x0, 0xBFFFF65C)      = 0 0
stat64("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0xBFFFE830, 0xBFFFF65C)         = 0 0
open("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x0, 0x0)         = 3 0
pread(0x3, "\312\376\272\276\0", 0x1000, 0x0)        = 4096 0
pread(0x3, "\316\372\355\376\a\0", 0x1000, 0x6000)       = 4096 0
mmap(0x4D3000, 0x2000, 0x1, …
Run Code Online (Sandbox Code Playgroud)

g++ illegal-instruction osx-lion

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

将扇区加载到内存时出现磁盘读取错误

我试图开发利用的bootloader 这个,但是当它时,它会显示:

disk read error!
Run Code Online (Sandbox Code Playgroud)

如果我忽略它,在后面的部分,它会显示我错误的内存映射.我也跟着其他一些消息来源但是徒劳无功.感觉就像我只是在复制他们正在做的事情.如果我做的甚至有点不同,每次都会产生一种新的错误.

我应该使用已经构建的引导加载程序还是该怎么做?

磁盘加载错误代码如下:

[org 0x7c00]

    KERNEL_OFFSET equ 0x1000    
    mov [BOOT_DRIVE], dl        
    mov bp, 0x9000          
    mov sp, bp  
    mov bx, MSG_REAL_MODE       
    call print_string           
    call load_kernel            
    jmp $

print_string:
    pusha
    mov ah, 0x0e

loop:
    mov al,[bx]
    cmp al, 0
    je return
    int 0x10
    inc bx
    jmp loop

return:
    popa
    ret

disk_load: 
    push dx                                              
    mov ah, 0x02                                   
    mov al, dh                                          
    mov ch, 0x00                                    
    mov dh, 0x00                                     
    mov cl, 0x02                                    
    int 0x13                                           
    jc disk_error                                  
    pop dx                                               
    cmp dh, …
Run Code Online (Sandbox Code Playgroud)

assembly kernel qemu osdev bootloader

10
推荐指数
1
解决办法
1130
查看次数

java.lang.ClassCastException:无法转换为javax.xml.bind.JAXBElement

我使用Spring启动来调用web服务.

我的配置类如下:

@Configuration
public class ClientAppConfig {
@Bean
public Jaxb2Marshaller marshaller() {
    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setPackagesToScan("com.client.stub");
    return marshaller;
}

@Bean
public ARTestClient arTestClient(Jaxb2Marshaller marshaller) {
    ARTestClient client = new ARTestClient();
    client.setDefaultUri("uri");
    client.setMarshaller(marshaller);
    client.setUnmarshaller(marshaller);
   return client;
}
Run Code Online (Sandbox Code Playgroud)

我打电话给服务如下:

    OutputMessageType response = (OutputMessageType) getWebServiceTemplate().marshalSendAndReceive(
            inputMessageType, new SoapActionCallback("http://Serviceuri"));
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

   [2016-03-18 14:45:43.697] boot - 10272 ERROR [http-nio-8080-exec-1] --- [dispatcherServlet]: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception 
  [Request processing failed; nested exception is java.lang.ClassCastException: javax.xml.bind.JAXBElement 
  cannot be cast to …
Run Code Online (Sandbox Code Playgroud)

spring jaxb unmarshalling spring-boot

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

如果我要在程序集中编写程序,那么这个HelloWorld汇编代码的哪些部分是必不可少的?

我有这个简短的你好世界计划:

#include <stdio.h>

static const char* msg = "Hello world";

int main(){
    printf("%s\n", msg);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

我用gcc将它编译成以下汇编代码:

    .file   "hello_world.c"
    .section    .rodata
.LC0:
    .string "Hello world"
    .data
    .align 4
    .type   msg, @object
    .size   msg, 4
msg:
    .long   .LC0
    .text
    .globl  main
    .type   main, @function
main:
.LFB0:
    .cfi_startproc
    pushl   %ebp
    .cfi_def_cfa_offset 8
    .cfi_offset 5, -8
    movl    %esp, %ebp
    .cfi_def_cfa_register 5
    andl    $-16, %esp
    subl    $16, %esp
    movl    msg, %eax
    movl    %eax, (%esp)
    call    puts
    movl    $0, %eax
    leave
    .cfi_restore 5
    .cfi_def_cfa …
Run Code Online (Sandbox Code Playgroud)

c linux x86 assembly

10
推荐指数
1
解决办法
1149
查看次数

从Eclipse中调试maven程序集

我在Eclipse中有一个项目,在组装之后具有以下的包结构

launcher.tar.gz
 |-- launcher.jar
 |-- lib/
 |-- resources/
 |-- plugins/
Run Code Online (Sandbox Code Playgroud)

这是使用的maven-assembly-plugin.

为了使应用程序正常启动,有些resources是必需的,但在最终装配之外不可用,另外,我希望能够像我目前那样安装插件.

我目前的工作流程是

$ mvn [clean] package
$ cd target/launcher/
$ java -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -jar launcher.jar
Run Code Online (Sandbox Code Playgroud)

一旦应用程序以挂起状态启动,我可以附加调试器并恢复我的正常工作流程.

如何从Eclipse简化此过程?

可以从我的Launcher.java类启动它,但是在Eclipse中调试时,我无法通过此方法安装插件.

java eclipse debugging maven maven-assembly-plugin

10
推荐指数
1
解决办法
1103
查看次数

"nop dword ptr [rax + rax]"x64汇编指令有什么作用?

我正在尝试理解x64编译器完成的程序集优化.

我在Windows 8.1上Release使用Visual Studio 2008 SP1IDE 编译了一个小型C++项目.

其中一行包含以下汇编代码:

B8 31 00 00 00   mov         eax,31h
0F 1F 44 00 00   nop         dword ptr [rax+rax]
Run Code Online (Sandbox Code Playgroud)

这是一个截图:

在此输入图像描述

据我所知nop本身是do nothing,但我从来没有用那种操作见过它.

有人可以解释它是做什么的吗?

assembly x86-64 cpu-architecture visual-studio nop

10
推荐指数
2
解决办法
2945
查看次数

如何在springboot中的ConversionService中自动装配

试图在springboot中访问模型中的ConversionControl,没有运气.

@Component
public class CityHelperService  {

    @Autowired
    ConversionService conversionService;// = ConversionServiceFactory.registerConverters();

    public City toEntity(CityDTO dto){
        City entity = conversionService.convert(dto, City.class);
        return entity;
    }

    public CityDTO toDTO(City entity){
        CityDTO dto = conversionService.convert(entity, CityDTO.class);
        return dto;
    }
}
Run Code Online (Sandbox Code Playgroud)

它显示以下错误:

Injection of autowired dependencies failed;
nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.lumiin.mytalk.model.CityModel com.lumiin.mytalk.controllers.CityController.cityModel;
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cityModel' defined in file : Unsatisfied dependency expressed through constructor argument with index 1 of type [com.lumiin.mytalk.dao.CityHelperService]: : Error …
Run Code Online (Sandbox Code Playgroud)

java spring spring-mvc spring-boot

9
推荐指数
1
解决办法
1万
查看次数

Spring boot:配置tomcat服务器以使用html5Mode

问题:如何在spring boot中配置.htaccess?

angularjs提供html5Mode,这使您的应用程序使用基于pushstate的URL而不是hashtags.但是,这需要服务器端支持,因为生成的URL也需要正确呈现.

如果您在Apache服务器上运行角度应用程序,则可以在.htaccess文件中轻松添加此规则.

# Apache .htaccess

# angularjs pushstate (history) support:
# See http://www.josscrowcroft.com/2012/code/htaccess-for-html5-history-pushstate-url-routing/
<ifModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !index
    RewriteCond %{REQUEST_URI} !.*\.(css¦js|html|png) #Add extra extensions needed.
    RewriteRule (.*) index.html [L]
</ifModule>
Run Code Online (Sandbox Code Playgroud)

apache .htaccess spring spring-boot

9
推荐指数
1
解决办法
3050
查看次数

如何扩展Spring Boot应用程序?

据我所知,Spring Boot有一个内置的Tomcat服务器(或Jetty),可以促进快速开发.但是,当您因为流量增加而需要扩展应用程序时,您会怎么做?

spring tomcat scalability spring-boot

9
推荐指数
1
解决办法
5418
查看次数